package com.zhuss.core.db.dao.ext;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.core.book.SearchBookBo;
import com.zhuss.bean.vo.core.book.DetailBookVo;
import com.zhuss.bean.vo.core.book.ListBookVo;
import com.zhuss.core.db.dao.gen.BookMapper;
import com.zhuss.core.db.entity.Book;

@Component
public class BookDao extends BookMapper {
	
	@Autowired
    private MongoTemplate mongoTemplate;
	
	public void create(Book book) {
		System.out.println(System.currentTimeMillis());
		mongoTemplate.save(book);
		System.out.println(System.currentTimeMillis());
	}
	
	public void delete(Book book) {
		mongoTemplate.remove(book);
	}
	
	public List<Book> listAll() {
		System.out.println(System.currentTimeMillis());
		List<Book> list = mongoTemplate.findAll(Book.class);
		System.out.println(list.size());
		System.out.println(System.currentTimeMillis());
		return list;
	}
	
	public List<ListBookVo> list(SearchBookBo bo) {
		
		return null;
	}
	
	public Integer countList(SearchBookBo bo) {
		
		return null;
	}
	
	public DetailBookVo detail(Long bookId) {
		
		return null;
	}
	
	public List<Long> listByName(String name, Integer status) {
		
		return null;
	}
	
//	void create(Book record);
//	
//	void delete(Book record);
//	
//	List<Book> listAll();
//	
//	List<ListBookVo> list(SearchBookBo bo);
//
//	Integer countList(SearchBookBo bo);
//
//	DetailBookVo detail(@Param("bookId") Long bookId);
//	
//	List<Long> listByName(@Param("name") String name, @Param("status") Integer status);

    
}